﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Kugar.Core.WinForm.ControlExtMethod
{
    public static class LabelExt
    {
        public static Size GetTrueSize(this Label label)
        {
            Graphics g = Graphics.FromHwnd(label.Handle);
            SizeF size = g.MeasureString(label.Text, label.Font);//获取大小  
            g.Dispose();

            return new Size((int) size.Width,(int) size.Height);
        }
    }
}
